home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / UPC12BS1.ZIP / LIB / STRLWR.C < prev    next >
C/C++ Source or Header  |  1993-07-22  |  2KB  |  76 lines

  1. /*--------------------------------------------------------------------*/
  2. /*       UUPC/extended string lower function                          */
  3. /*                                                                    */
  4. /*       Copyright 1992, Andrew H. Derbyshire                         */
  5. /*                                                                    */
  6. /*       Why this function doesn't exist in GCC is beyond me          */
  7. /*--------------------------------------------------------------------*/
  8.  
  9.  
  10.  
  11. /*--------------------------------------------------------------------*/
  12. /*                          RCS Information                           */
  13. /*--------------------------------------------------------------------*/
  14.  
  15. /*
  16.  *    $Id: strlwr.c 1.5 1993/07/22 23:19:50 ahd Exp $
  17.  *
  18.  *    Revision history:
  19.  *    $Log: strlwr.c $
  20.  *     Revision 1.5  1993/07/22  23:19:50  ahd
  21.  *     First pass for Robert Denny's Windows 3.x support changes
  22.  *
  23.  *     Revision 1.4  1993/04/11  00:32:05  ahd
  24.  *     Global edits for year, TEXT, etc.
  25.  *
  26.  * Revision 1.3  1992/11/30  03:26:20  ahd
  27.  * Much better if strlwr makes the string LOWER case
  28.  *
  29.  * Revision 1.2  1992/11/19  02:58:39  ahd
  30.  * drop rcsid
  31.  *
  32.  * Revision 1.1  1992/11/16  05:00:26  ahd
  33.  * Initial revision
  34.  *
  35.  */
  36.  
  37.  
  38. /*--------------------------------------------------------------------*/
  39. /*                       Standard include files                       */
  40. /*--------------------------------------------------------------------*/
  41.  
  42. #include <stdio.h>
  43. #include <string.h>
  44. #include <stdlib.h>
  45. #include <ctype.h>
  46.  
  47. /*--------------------------------------------------------------------*/
  48. /*                    UUPC/extended include files                     */
  49. /*--------------------------------------------------------------------*/
  50.  
  51. #include "lib.h"
  52.  
  53. /*--------------------------------------------------------------------*/
  54. /*       s t r l w r                                                  */
  55. /*                                                                    */
  56. /*       Convert a string to lower case                               */
  57. /*--------------------------------------------------------------------*/
  58.  
  59. char *strlwr( char *s )
  60. {
  61.    char *save = s;
  62.  
  63.    if ( s == NULL )
  64.       return s;
  65.  
  66.    while ( *s != '\0' )
  67.    {
  68.       if ( isupper( *s ))
  69.          *s = tolower( *s );
  70.       s += 1;
  71.    } /* while */
  72.  
  73.    return save;
  74.  
  75. } /* strlwr */
  76.